package com.vates.vsp.practico.alumnos.business;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

import com.vates.vsp.practico.alumnos.view.AlumnosView;
import com.vates.vsp.practico.commons.UseCaseMode;

@ManagedBean(name = "alumnoListener")
@SessionScoped
public class AlumnoListener {

	@ManagedProperty(value = "#{alumnoView}")
	private AlumnosView alumnosView;

	public AlumnosView getAlumnosView() {
		return alumnosView;
	}

	public void setAlumnosView(AlumnosView alumnosView) {
		this.alumnosView = alumnosView;
	}

	public String nuevoAlumno() {
		Alumnos alumno = new Alumnos();
		alumnosView.setUseCaseMode(UseCaseMode.NUEVO);
		//alumnosView.setAlumno(alumno);
		return "new";
	}

	public String eliminarAlumno() {
		Alumnos alumno = new Alumnos();
		alumnosView.setUseCaseMode(UseCaseMode.ELIMINAR);
		//alumnosView.setAlumno(alumno);
		return "delete";
	}

	public String modificarAlumno() {
		Alumnos alumno = new Alumnos();
		alumnosView.setUseCaseMode(UseCaseMode.MODIFICACION);
		//alumnosView.setAlumno(alumno);
		return "modif";
	}

	public String volver() {
		return "return";
	}

	public String salir() {
		return "exit";
	}
}
